/**
 * @description 个人主页 API 路由
 * @author 刘煎蛋
 */

const router = require('koa-router')();
const { follow, unFollow } = require('../../controller/user-relation');

router.prefix('/api/profile');

router.post('/follow', async ( ctx, next ) => {
    // const { id: myUserId } = ctx.session.userInfo;
    // const { userId: curUserId } = ctx.request.body;
    const myUserId = 1,
            curUserId = 3;
            
    ctx.body = await follow( myUserId, curUserId );

})

router.post('/unFollow', async ( ctx, next ) => {
    // const { id: myUserId } = ctx.session.userInfo;
    // const { userId: curUserId } = ctx.request.body;
    const myUserId = 3,
            curUserId = 2;

    ctx.body = await unFollow( myUserId, curUserId );
})

module.exports = router


